﻿using System;
using System.IO;

namespace CONEK911Manager.DTO
{
    class Logger
    {
        public static void WriteLog(string contents)
        {
            if (!Directory.Exists("Log"))
            {
                Directory.CreateDirectory("Log");
            }
            string path = "Log/" + DateTime.Now.Date.ToString("yyyy-MM-dd") + ".txt";
            if (!File.Exists(path))
            {
                File.Create(path).Dispose();
            }
            using (StreamWriter sw = File.AppendText(path))
            {
                sw.WriteLine(contents);
            }
        }
    }
}
